struct state {
	int *status;
	int status1;     /* current state */
	int status2;     /* next state */
	int final;       /* final status */
	int stable;      /* 1 : stable */
	int flag;        /* -2 : temporary; -1 : undetermined ; 0 : normal state; 1 : steady state; 2 : normal state, final state is a cycle; 3 : cycle state ; 4 : unstable state ; 5 : final state is an unstable state */
	int length;      /* the trajectory length from the current state to the final state */
	int pnflag;      /* 1 : already printed (for cycled process) */
};

void init_state (struct state *state, int n, int N);

void generate_network (int N, int mode, int mode1, int network[N][N], float ratio, float ratio2, int *nR, int *nG);

int dynamics (int N, int state[N], int network[N][N]);
int check_stable (int N, int i, struct state *state, int network[N][N], int mode);
void check_final (int N, int n, struct state *state);

void get_process (int N, int L, int pathway[L][N], struct state *state, int start);
int check_process (int N, int L, int pathway[L][N]);
int check_trigglecycle (int N, int L, int pathway[L][N]);
void print_process (int N, int L, int pathway[L][N], int mode, int trigger, int no);
